package com.ruoyi.teaching.mapper;

import com.ruoyi.teaching.domain.PlatformUResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 王旭
 * @since 2024-06-26
 */
@Mapper
public interface PlatformUResourceMapper extends BaseMapper<PlatformUResource> {

    @Update("UPDATE platform_u_resource SET download_count = download_count + #{count} WHERE id = #{resourceId}")
    void incrementDownloadCount(@Param("resourceId") Long resourceId,@Param("count")  int count);
}
